package com.jblv.frame.user.api.vo;


import com.jblv.frame.common.utils.tree.TreeNode;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;

import java.io.Serializable;
import java.util.List;
import java.util.Objects;

/**
 * @author happyonion.yangtao
 * @version 1.0
 * @title SysMenuDTO
 * @projectName jblv-frame
 * @packageName com.jblv.web.dto
 * @description 菜单列表DTO
 * @date Create at 2020/5/26 22:03
 * @since jdk1.8
 */
@ApiModel(value="菜单DTO类",description="菜单数据传类" )
public class SysMenuListVO implements TreeNode<String>,Serializable {
    private static final long serialVersionUID = -2568783836533671362L;

    /**
     * 菜单ID
     */
    @ApiModelProperty(value = "menuId",example="45a4f4f898944d7d952535509095f248")
    private String menuId;
    /**
     * 上级菜单ID，一级菜单为0
     */
    @ApiModelProperty(example="52ww",required = false)
    private String parentId;

    /**
     * 上级菜单名称，一级菜单为顶级
     */
    @ApiModelProperty(example="顶级",required = false)
    private String parentName;

    /**
     * 菜单名称
     */
    @ApiModelProperty(example="政治部")
    private String name;


    @ApiModelProperty()
    private List<SysMenuListVO> children;

    public SysMenuListVO() {

    }
    public SysMenuListVO(String menuId, String parentId, String name) {
        this.menuId = menuId;
        this.parentId = parentId;
        this.name = name;
    }

    @Override
    public String id() {
        return this.getMenuId();
    }

    @Override
    public Boolean root() {
        return Objects.equals(this.parentId, "0");
    }

    @Override
    public String parentId() {
        return this.getParentId();
    }

    @Override
    public List<SysMenuListVO> getChildren() {
        return children;
    }

    @Override
    public void setChildren(List children) {
        this.children = children;
    }



    public String getMenuId() {
        return menuId;
    }

    public void setMenuId(String menuId) {
        this.menuId = menuId;
    }

    public String getParentId() {
        return parentId;
    }

    public void setParentId(String parentId) {
        this.parentId = parentId;
    }

    public String getParentName() {
        return parentName;
    }

    public void setParentName(String parentName) {
        this.parentName = parentName;
    }


    public String getName() {
        return name;
    }

    public void setName(String name) {
        this.name = name;
    }



}
